package com.rt.gptnext.common.utils;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

/**
 * @author gaoyiyang
 */
public class AuthUtil {

    public static String getUser() {
        try {
            HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
            return request.getHeader("user");
        } catch (Exception ignored) {
        }
        return null;
    }

}
